
package com.innovamed.websocket.model;

import java.io.Serializable;
import java.util.List;


/** Copyright: Copyright (c) 2018 Jun_Zhou
 * 
 * @ClassName: WSMsg.java
 * @Description: websoket相关的工具类;
 * @version: v1.0.0
 * @author: JunZhou
 * @Email: 1769676159@qq.com
 * @Site: CERNO
 * @date: 2018年12月11日 下午11:03:22 */
public class WsMsg implements Serializable
{
	private static final long	serialVersionUID	= -4417016802768715406L;
	/**
	 * 消息代码;
	 */
	public String				msgCode;
	
	/**
	 * 事件类型;
	 */
	public String				eventType;
	
	/**
	 * 消息内容;
	 */
	public String				msgBody;
	
	/**
	 * 单个消息接收者;
	 */
	private String				receiver;
	
	/**
	 * 消息接收者列表;
	 */
	private List<String>		receiverList;
	
	public WsMsg()
	{
		super();
	}
	
	public WsMsg(String msgBody)
	{
		super();
		this.msgBody = msgBody;
	}
	
	public WsMsg(String msgCode, String msgBody)
	{
		this.msgCode = msgCode;
		this.msgBody = msgBody;
	}
	
	/**
	 * 通用消息主体构造函数;
	 * @param msgCode:消息代码，任意，建议字符串数字;eg:"1001"
	 * @param eventType:事件类型,提供前端筛选条件，建议和模块对应;eg:"dh_pipeline_info"
	 * @param msgBody:消息主体，Json字符串;
	 */
	public WsMsg(String msgCode, String eventType, String msgBody)
	{
		this.msgCode = msgCode;
		this.eventType = eventType;
		this.msgBody = msgBody;
	}
	
	/**
	 * 通用消息主体构造函数;
	 * @param msgCode:消息代码，任意，建议字符串数字;eg:"1001"
	 * @param eventType:事件类型,提供前端筛选条件，建议和模块对应;eg:"dh_pipeline_info"
	 * @param msgBody:消息主体，Json字符串;
	 * @param receiverList:接收的id列表;
	 */
	public WsMsg(String msgCode, String eventType, String msgBody, String receiver, List<String> receiverList)
	{
		this.msgCode = msgCode;
		this.eventType = eventType;
		this.msgBody = msgBody;
		this.receiverList = receiverList;
	}
	
	/**
	 * 通用消息主体构造函数;
	 * @param msgCode:消息代码，任意，建议字符串数字;eg:"1001"
	 * @param eventType:事件类型,提供前端筛选条件，建议和模块对应;eg:"dh_pipeline_info"
	 * @param msgBody:消息主体，Json字符串;
	 * @param receiver:接收的id;
	 */
	public WsMsg(String msgCode, String eventType, String msgBody, String receiver)
	{
		this.msgCode = msgCode;
		this.eventType = eventType;
		this.msgBody = msgBody;
		this.receiver = receiver;
	}
	
	public String getReceiver()
	{
		return receiver;
	}
	
	public void setReceiver(String receiver)
	{
		this.receiver = receiver;
	}
	
	public List<String> getReceiverList()
	{
		return receiverList;
	}
	
	public void setReceiverList(List<String> receiverList)
	{
		this.receiverList = receiverList;
	}
	
	public String getMsgCode()
	{
		return msgCode;
	}
	
	public void setMsgCode(String msgCode)
	{
		this.msgCode = msgCode;
	}
	
	public String getMsgBody()
	{
		return msgBody;
	}
	
	public void setMsgBody(String msgBody)
	{
		this.msgBody = msgBody;
	}
	
	public String getEventType()
	{
		return eventType;
	}
	
	public void setEventType(String eventType)
	{
		this.eventType = eventType;
	}
}
